/**
 * 主页
 */
import HomePage from "@/views/home/Home.vue";


import { createWebHistory, createRouter } from 'vue-router'
import { Calendar, Setting, User, Grid, DataLine } from "@element-plus/icons-vue";
import {
    RECORD_PAGE,
    CABINET_PAGE,
    SETTINGS_PAGE,
} from "@/common/names";






// 公共路由

export const routes = [
    {
        path: "/",
        redirect: (to) => {
            return RECORD_PAGE;
        },
        component: HomePage,
        children: [
            {
                path: "/record",
                name: RECORD_PAGE,
                meta: {
                    label: "使用记录",
                    icon: Calendar,
                },
                component: () => import("@/views/record/DetectionRecord.vue"),
            },
            {
                path: "/cabinet",
                name: CABINET_PAGE,
                meta: {
                    label: "格子管理",
                    icon: Grid,
                },
                component: () => import("@/views/cabinet/CabinetList.vue"),
            },
            {
                path: "/setting",
                name: SETTINGS_PAGE,
                meta: {
                    label: "系统设置",
                    icon: Setting,
                },
                component: () => import("@/views/settings/SettingsPage.vue"),
            },
        ],
    },
    //    {
    //       path: '/login',
    //       name: 'LOGIN_PAGE',
    //       component: () => import("@/views/login/Login.vue"),
    //       meta: {
    //           title: '登录'
    //       }
    //    },
    {
        path: "/:pathMatch(.*)*",
        redirect: (to) => {
            return {
                path: "/",
            };
        },
    },
];
